package com.example.myviewgroup;

import android.view.View;
import android.view.ViewGroup;

/**
 * author: ts
 * created on: 2021/8/28 下午3:55
 * description:
 */
public abstract class MyBaseAdapter {

    public boolean mIsDelete = false;

    public abstract int getItemCount();

    public abstract View getView(int position, ViewGroup viewGroup);

    private OnDataChangedListener onDataChangedListener;

    public void notifyDataChanged() {
        if (this.onDataChangedListener != null) {
            this.onDataChangedListener.onChanged();
        }
    }

    public void setOnDataChangedListener(OnDataChangedListener listener) {
        this.onDataChangedListener = listener;
    }

    interface OnDataChangedListener {
        void onChanged();
    }
}
